<html><head><title>Box</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">Box()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#006666"><b>Box</b></font>(x, y, Width, Height [, Color])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Draw a box of given dimensions on the current output. The filling mode is determined by <a href="drawingmode.html">DrawingMode()</a>. 
The current output is set with <a href="startdrawing.html">StartDrawing()</a>. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>x, y, Width, Height</i></td>
<td width="90%"> 
The position and size of the box in the current drawing output. 

</td></tr>
<tr><td><i>Color (optional)</i></td>
<td> 
The color to be used for the box. If this parameter is not specified, the default color 
set with <a href="frontcolor.html">FrontColor()</a> will be used. 
This color can be in <a href="../2ddrawing/rgb.html">RGB</a> or <a href="../2ddrawing/rgba.html">RGBA</a> format. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 200, 200, "2DDrawing Example", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <b><font color="#006666">If</font></b> <font color="#006666">CreateImage</font>(0, 200, 200) <b><font color="#006666">And</font></b> <font color="#006666">StartDrawing</font>(<font color="#006666">ImageOutput</font>(0))
      y = 0
      <b><font color="#006666">For</font></b> x = 0 <b><font color="#006666">To</font></b> 95 <b><font color="#006666">Step</font></b> 10
<font color="#006666">        Box</font>(x, y, 200-2*x, 200-2*y,<font color="#006666"> RGB</font>(<font color="#006666">Random</font>(255),<font color="#006666"> Random</font>(255),<font color="#006666"> Random</font>(255)))
        y + 10        <font color="#006666">; the same as y = y + 10</font>
      <b><font color="#006666">Next</font></b> x
<font color="#006666">      StopDrawing</font>() 
<font color="#006666">      ImageGadget</font>(0, 0, 0, 200, 200,<font color="#006666"> ImageID</font>(0))
    <b><font color="#006666">EndIf</font></b>
    
    <b><font color="#006666">Repeat</font></b>
      Event =<font color="#006666"> WaitWindowEvent</font>()
    <b><font color="#006666">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>

<br>
<p><img src="../HelpPictures/box.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="roundbox.html">RoundBox()</a>, <a href="line.html">Line()</a>, <a href="circle.html">Circle()</a>, <a href="ellipse.html">Ellipse()</a> 
<a href="frontcolor.html">FrontColor()</a>, <a href="rgb.html">RGB()</a>, <a href="rgba.html">RGBA()</a>, <a href="drawingmode.html">DrawingMode()</a> 


</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=blue.html>Blue()</a> - <a href=index.html>2DDrawing Index</a> - <a href=boxedgradient.html>BoxedGradient()</a> ->


</body></html>